sergio ramos opened the scoring for real madrid in the first half at the bernabeu .
cristiano ronaldo then hit the post with a penalty before james rodriguez nets .
juanmi pulled one back for malaga but ronaldo scored late on to secure the win .
gareth bale and luka modric go off injured for real madrid .